import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
// 缩略图
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
import { Input, Carousel, CarouselItem, Message, Button, Pagination, Popconfirm } from 'element-ui'
// 导入element ui 的组件css样式
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'
import vueAxios from 'vue-axios'
// 导入格式化时间的插件
import moment from 'moment'
Vue.use(vueAxios, axios)
Vue.use(preview)
Vue.use(Input, Message, Button)
Vue.use(Pagination)
Vue.use(Popconfirm)
Vue.prototype.$message = Message
Vue.use(Carousel)
Vue.use(CarouselItem)
// 设置请求的根路径
axios.defaults.baseURL = 'http://192.168.43.140:8898'
// 定义全局的过滤器
Vue.filter('dateFormat', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
  return moment(dataStr).format(pattern)
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
